‫Welcome to our 10th lecture.
‫Now, we have been writing our apps here, we have an to add items have only you to get all the items.
‫Now, I would like us to do something about editing the item because you are having a mobile app that
‫is consuming your ERP.
‫Next instance, do an app that you have written.
‫You need to allow your users to be able to edit items inside of this application.
‫All right.
‫So let us read the function of the function here.
‫That is you when to call maybe something like did an item.
‫And here we are going to write a query that is going to go ahead and update our items.
‫So what do you want to do?
‫Here is frappé dot DBI don't ask.
‫You will probably be Esquibel.
‫And then what you want to be doing here is that we are going to be supplying a formatted string.
‫Remember here are doing six.
‫How many of those now.
‫Those are six.
‫And then here I am going to do update CC update and then the next thing I'm going to be supplying here
‫is my table.
‫So my table is tab item.
‫OK, so this is going to be the table of the table that you editing.
‫So update tab item.
‫And then what I'm going to do here, I want to set.
‫Nor do I want to sit here and again, remember this one who can pass anything so this for the purpose
‫of this one, this tutorial, let me edit this item.
‫This one, the first time I was doing I was testing it.
‫So you can see our second and third items are still called second them.
‫That item is when I return to updated fast API items so we can change our second item in changes to
‫update its agenda items.
‫So so we can get we can change the item name.
‫So item name.
‫So that said, item name and then we said the item name that we want Hyogo into hard code for now,
‫but we are going to be writing these things and expecting them to come from from from a parameter letter.
‫So the updated second item.
‫All right.
‫And then you remember in an update function of an API, you need to supply them.
‫We.
‫So you need to tell it where you want this thing to happen.
‫Because if you do this, it is going to update everything to this.
‫So you don't want that thing to do.
‫You don't want to agree to do that.
‫What you want to do is we are name.
‫Remember I told you again, name in ERP next is used as the primary key so we can see we are named equals
‫and we can check the name of this is way, way, way, way for Weisse.
‫So y y y y right.
‫So we are seeing update this set item name equals this one second API.
‫Don't forget API then because we want to retain that we are name.
‫Is this OK.
‫And then the next thing you're going to do after that is just to say frappé dot dbe dot com meet.
‫I hope you guessed it.
‫Yeah probably it.
‫And then we can just go ahead of course and return a message saying success.
‫This one again written whatever you want or done here.
‫But this one I'm just going to give us a text message thing that it has successfully that our our function.
‫So remember that if we leave this, there is not going to work.
‫So we need to do Frappier for a bit or at least so that everything is accessible.
‫We allow us to use.
‫And then what you want to do next is go back to your posthuman.
‫I had already tested it here.
‫And what you want to do is you're going to add you are you are you are in here.
‫This is supposed to be a post request.
‫You're going to add.
‫And by the way, even the the ad is going to be a post request not get so we can add something like
‫a D and then this is going to be for the.
‫We believe that sended and we have our item and we come to they did realize that it has had enough of
‫them.
‫So yes, this is supposed to be a post request.
‫Update is all going to be is supposed to be a post request.
‫When you will be working the front end applications, they are going to be very, very sensitive.
‫So you need to know exactly when will you pull up post and when you call and get because you will be
‫needing to do other things with the staff like crows, cause that is gross origin request and request
‫and all that.
‫All right.
‫So put you are you are you are you are you are FBI here.
‫Mine is my next update item.
‫So I'm going to put it here and then remember to pass the authorization token because I do not want
‫this one to be our function that is open to the public.
‫I'm not going to be allowing this to be accessible to the public.
‫I want it to be protected behind.
‫I talked to said this, and when you see this one return on success message, it means that it has successfully
‫updated.
‫And let's go back to the database.
‫See, it is now second item.
‫We reload and yes, we have an item and that's it.
‫That is how we write an API to update our our item list inside of ERP.
‫Next, they get so much in the next lecture.
‫What we're going to be looking at is how to delete an item from our database.
‫See you in that lecture.